/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csgui.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/**
 *
 * @author robert
 */
@Entity
public class User extends GridSimEntity{
    @Basic private Integer gridletCount;
    @ManyToOne private Broker broker;
    
    public User()
    {
    }

    public Integer getGridletCount() {
        return gridletCount;
    }

    public void setGridletCount(Integer gridletCount) {
        this.gridletCount = gridletCount;
    }

    public Broker getBroker() {
        return broker;
    }

    public void setBroker(Broker broker) {
        this.broker = broker;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof User)) {
            return false;
        }
        User other = (User) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "csgui.entities.User[ id=" + id + " ]";
    }
    
}
